@extends('Admin.layouts.application')

@section('css')

    <link rel="stylesheet" href="/assets/xSystem/vendor/webupload/dist/webuploader.css" />
    <link rel="stylesheet" type="text/css" href="/assets/xSystem/vendor/webupload/style.css" />
    <style>
        .fixed-layout .admin-header{
            z-index: 15;
        }
    </style>
@endsection
@section('content')
    <div class="admin-content">
        <div class="admin-content-body">
            <div class="am-cf am-padding am-padding-bottom-0">
                <div class="am-fl am-cf">
                    <strong class="am-text-primary am-text-lg">新增菜单信息</strong> /
                    <small>Add menu information</small>
                </div>
            </div>

            <hr>

            @include('Admin.layouts._flash')

            <div class="am-g">
                <div class="am-u-sm-12 am-u-md-12">


                    <form class="am-form" action="{{ route('hotelreferral.store') }}" method="post">
                        {!! csrf_field() !!}

                        <div class="am-tabs am-margin" data-am-tabs>
                            <ul class="am-tabs-nav am-nav am-nav-tabs">
                                <li class="am-active"><a href="#tab1">通用信息</a></li>
                                {{--<li><a href="#tab4">服务介绍</a></li>--}}
                                <li><a href="#tab3">菜单相册</a></li>
                            </ul>

                            <div class="am-tabs-bd">
                                <div class="am-tab-panel am-fade am-in am-active" id="tab1" style="overflow: hidden;">

                                    <div class="am-g am-margin-top">
                                        <div class="am-u-sm-4 am-u-md-2 am-text-right">
                                            所属菜单
                                        </div>
                                        <div class="am-u-sm-8 am-u-md-4 am-u-end col-end">

                                            <select data-am-selected="{btnWidth: '100%',  btnStyle: 'secondary', btnSize: 'sm', maxHeight: 360}"
                                                    name="category_id">
                                                @foreach($categories as $category)
                                                    <optgroup label="{{$category->name}}">
                                                    @foreach($category->children as $c)
                                                        @if(in_array($c->id, $cate_id) || $c->name =="留言信息" || $c->name =="客房点餐" || $c->name =="在线退房")
                                                            continue;
                                                        @else
                                                            <option value="{{$c->id}}">
                                                                {{$c->name}}
                                                            </option>
                                                        @endif
                                                    @endforeach

                                                @endforeach
                                            </select>
                                        </div>
                                        <div class="am-u-sm-8 am-u-md-4 am-u-end col-end">
                                            <label style="color: red">注：如没有二级菜单请添加二级菜单</label>
                                        </div>
                                    </div>

                                    {{--<div class="am-g am-margin-top">
                                        <div class="am-u-sm-4 am-u-md-2 am-text-right">
                                            服务名称
                                        </div>
                                        <div class="am-u-sm-8 am-u-md-4">
                                            <input type="text" class="am-input-sm" name="name">
                                        </div>
                                        <div class="am-hide-sm-only am-u-md-6">*必填，不可重复</div>
                                    </div>--}}



                                    <div class="am-g am-margin-top sort">
                                        <div class="am-u-sm-4 am-u-md-2 am-text-right">
                                            描述信息
                                        </div>
                                        <div class="am-u-sm-8 am-u-md-4 am-u-end col-end">
                                            <textarea rows="10" name="desc"></textarea>
                                        </div>
                                    </div>

                                    <div class="am-g am-margin-top">
                                        <div class="am-u-sm-4 am-u-md-2 am-text-right">
                                            是否显示
                                        </div>
                                        <div class="am-u-sm-8 am-u-md-4 am-u-end col-end">
                                            <label class="am-radio-inline">
                                                <input type="radio" value="1" name="is_show" checked> 是
                                            </label>
                                            <label class="am-radio-inline">
                                                <input type="radio" value="0" name="is_show"> 否
                                            </label>
                                        </div>
                                    </div>

                                </div>

                                {{--<div class="am-tab-panel am-fade" id="tab2">
                                    <div class="am-g am-margin-top-sm">
                                        <div class="am-u-sm-12 am-u-md-12">
                                            <div id="markdown">
                                                <textarea id="editor_id" name="content"
                                                          style="height: 300px"></textarea>
                                            </div>
                                        </div>
                                    </div>

                                </div>--}}

                                {{--<div class="am-tab-panel am-fade" id="tab4">
                                    <div class="am-g am-margin-top-sm">
                                        <div class="am-u-sm-12 am-u-md-12">
                                            <div id="markdown" >
                                                <script id="container" name="content" type="text/plain"></script>
                                            </div>
                                        </div>
                                    </div>

                                </div>--}}

                                <div class="am-tab-panel am-fade" id="tab3">
                                    <div id="uploader">
                                        <div class="queueList">
                                            <div id="dndArea" class="placeholder">
                                                <div id="filePicker"></div>
                                                <p>或将照片拖到这里，单次最多可选300张</p>
                                            </div>
                                        </div>
                                        <div class="statusBar" style="display:none;">
                                            <div class="progress">
                                                <span class="text">0%</span>
                                                <span class="percentage"></span>
                                            </div>
                                            <div class="info"></div>
                                            <div class="btns">
                                                <div id="filePicker2"></div>
                                                <div class="uploadBtn">开始上传</div>
                                            </div>
                                        </div>

                                        <div id="imgs"></div>
                                    </div>
                                </div>
                            </div>
                        </div>

                        <div class="am-margin">
                            <button type="submit" class="am-btn am-btn-primary am-radius">提交保存</button>
                        </div>
                    </form>
                </div>
            </div>

        </div>
        @include('Admin.layouts._footer')
    </div>
@endsection

@section('js')
    <script src="/assets/xSystem/js/jquery.html5-fileupload.js"></script>
    <script src="/assets/xSystem/js/upload.js"></script>
    <script src="/assets/xSystem/vendor/ckfinder/ckfinder.js"></script>
    <script src="/assets/xSystem/js/ck_upload.js"></script>

    <script type="text/javascript" src="/assets/xSystem/vendor/webupload/dist/webuploader.js"></script>
    <script type="text/javascript" src="/assets/xSystem/vendor/webupload/upload.js"></script>

    {{--<!-- kindeditor编辑器 -->
    <script charset="utf-8" src="/assets/xSystem/vendor/kindeditor/kindeditor-all-min.js"></script>
    <script charset="utf-8" src="/assets/xSystem/vendor/kindeditor/lang/zh-CN.js"></script>
    <script>
        KindEditor.ready(function (K) {

            window.editor = K.create('#editor_id');

        });
    </script>--}}

    <!-- 百度编辑器 -->

     <!-- 配置文件 -->
     <script type="text/javascript" src="/assets/xSystem/vendor/ueditor/ueditor.config.js"></script>
     <!-- 编辑器源码文件 -->
     <script type="text/javascript" src="/assets/xSystem/vendor/ueditor/ueditor.all.js"></script>
     <!-- 实例化编辑器 -->
     <script type="text/javascript">
         var ue = new UE.ui.Editor({initialFrameHeight:400});
         ue.render("container");
     </script>





@endsection
